package com.itheima.pojo;

import java.sql.Date;
import java.util.List;

// User类的对象就是来存储user表中的数据
public class User {
    private Integer id;
    private String username;
    private Date birthday;
    private String sex;
    private String address;

    /*一个用户包含一个扩展信息*/
    private Userinfo userinfo;
    /*一个用户包含多个订单*/
    private List<Order>orders;
    public User() {
    }

    public User(Integer id, String username, Date birthday, String sex, String address) {
        this.id = id;
        this.username = username;
        this.birthday = birthday;
        this.sex = sex;
        this.address = address;
    }

    public User(Integer id, String username, Date birthday, String sex, String address, Userinfo userinfo) {
        this.id = id;
        this.username = username;
        this.birthday = birthday;
        this.sex = sex;
        this.address = address;
        this.userinfo = userinfo;
    }

    public User(Integer id, String username, Date birthday, String sex, String address, Userinfo userinfo, List<Order> orders) {
        this.id = id;
        this.username = username;
        this.birthday = birthday;
        this.sex = sex;
        this.address = address;
        this.userinfo = userinfo;
        this.orders = orders;
    }

    /**
     * 获取
     * @return id
     */
    public Integer getId() {
        return id;
    }

    /**
     * 设置
     * @param id
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * 获取
     * @return username
     */
    public String getUsername() {
        return username;
    }

    /**
     * 设置
     * @param username
     */
    public void setUsername(String username) {
        this.username = username;
    }

    /**
     * 获取
     * @return birthday
     */
    public Date getBirthday() {
        return birthday;
    }

    /**
     * 设置
     * @param birthday
     */
    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    /**
     * 获取
     * @return sex
     */
    public String getSex() {
        return sex;
    }

    /**
     * 设置
     * @param sex
     */
    public void setSex(String sex) {
        this.sex = sex;
    }

    /**
     * 获取
     * @return address
     */
    public String getAddress() {
        return address;
    }

    /**
     * 设置
     * @param address
     */
    public void setAddress(String address) {
        this.address = address;
    }



    /**
     * 获取
     * @return userinfo
     */
    public Userinfo getUserinfo() {
        return userinfo;
    }

    /**
     * 设置
     * @param userinfo
     */
    public void setUserinfo(Userinfo userinfo) {
        this.userinfo = userinfo;
    }


    /**
     * 获取
     * @return orders
     */
    public List<Order> getOrders() {
        return orders;
    }

    /**
     * 设置
     * @param orders
     */
    public void setOrders(List<Order> orders) {
        this.orders = orders;
    }

    @Override
    public String toString() {
        return "User{id = " + id + ", username = " + username + ", birthday = " + birthday + ", sex = " + sex + ", address = " + address + ", userinfo = " + userinfo + ", orders = " + orders + "}";
    }
}
